﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharePointSlideShow.Model;
using SharePointSlideShow.Persistence;
using Microsoft.SharePoint;

namespace SharePointSlideShow.Provider
{
    public class SlideManager:IManager
    {
        /// <summary>
        /// Mark Readonly so it can be assinged only during static initialization
        /// </summary>
        private static readonly SlideManager instance = new SlideManager();
        /// <summary>
        /// Initializes a new instance of the <see cref=" SlideManager"/>class.
        /// </summary>
        private SlideManager()
        {
        }
        /// <summary>
        /// Singleton static initialization implementation
        /// </summary>
        /// <remarks>
        /// The public static property provide  a global access point to the instance.
        /// Also, because the constructor is private, the singleton class cannot be instaniated outside of the class itself.
        /// therefore,the varaiable refers to the only instance that can exist in the system.
        /// </remarks>
        public static SlideManager Instance
        {
            get { return instance; }
        }
        /// <summary>
        /// Returns all the availabe images
        /// </summary>
        /// <returns></returns>
        public SPListItemCollection GetImages(string Siteurl, string ListName)
        {
            return SlideImage.GetImages(Siteurl,ListName);
        }

        public SPListItemCollection GetImages(string Siteurl,string ListName, int NoofImages)
        {
            return SlideImage.GetImages(Siteurl,ListName, NoofImages);
        }

        public SPListItemCollection GetImages(string Siteurl,string ListName, string  FolderName)
        {
            return SlideImage.GetImages(Siteurl,ListName, FolderName);
        }

        public SPListItemCollection GetImages(string Siteurl,string ListName, bool IncludeFolder)
        {
            return SlideImage.GetImages(Siteurl,ListName, IncludeFolder);
        }

        public SPListItemCollection GetImages(string Siteurl,string ListName, bool IncludeFolder,string FolderName)
        {
            return SlideImage.GetImages(Siteurl,ListName, IncludeFolder,FolderName);
        }
        public SPListItemCollection GetImages(string Siteurl,string ListName, int NoofImages, string FolderName)
        {
            return SlideImage.GetImages(Siteurl,ListName, NoofImages, FolderName);
        }
        public SPListItemCollection GetImages(string Siteurl,string ListName, int NoofImages, bool IncludeFolder)
        {
            return SlideImage.GetImages(Siteurl,ListName, NoofImages, IncludeFolder);
        }

        public SPListItemCollection GetImages(string Siteurl,string ListName,bool IncludeFolder,string FolderName,int NoofImages)
        {
            return SlideImage.GetImages(Siteurl,ListName, IncludeFolder, FolderName, NoofImages);
        }

    }
}
